<?php
Zend_Loader::loadClass('Application_PlotData');

class Application_Printer 
{
	
	public function printGraph($plotData) {
		
		// Codice di selezione della libreria da utilizzare per la stampa dei grafici
		$printer = "pchart";
	    //Zend_Debug::dump($myData); exit;
		if (!empty($printer)) {
			try {
				Zend_Loader::loadClass(ucfirst($printer), dirname(__FILE__).'/Printer');
				$printerInstance = new $printer($plotData);
				$printerInstance->loadCartridge($plotData->getCartridge());
				$printerInstance->call();
				
			} catch (Zend_Exception $ze) {
				$this->errors = "No Class: " . ucfirst($printer);
			}
		}
		else
			$this->errors = "Bad arguments";
		
		//$printerInstance->setCartridge();
		//$printerInstance->submit();
	}
	
	public  function printLegend($plotData) {
		//$legend = $plotData->getLegend();
		//return $legend;
	}
}


